define(['app'], function (app) {
app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {

	//默认路由
	$urlRouterProvider
	.when('', '/zhuye')
	.when('/dingdan0', '/dingdan/qbdd')
	.when('/dingdan1', '/dingdan/dfk')
	.when('/dingdan2', '/dingdan/dsh')
	.when('/dingdan3', '/dingdan/dpj')
	.when('/dingdan4', '/dingdan/tksh');

	//路由规则

	$stateProvider
	//主页路由
	.state('zhuye', {
		url: '/zhuye',
		templateUrl: 'zhuye/zhuye.html',
		//主页控制器
		controller: 'ZhuyeCtrl'
	})
	//超市路由
	.state('sscs', {
		url: '/sscs',
		templateUrl: 'sscs/sscs.html',
		//超市控制器
		controller: 'SscsCtrl'
	})
	//购物车路由
	.state('gouwuche', {
		url: '/gouwuche',
		templateUrl: 'gouwuche/gouwuche.html',
		//购物车控制器
		controller: 'GouwucheCtrl'
	})
	//我的路由
	.state('wode', {
		url: '/wode',
		templateUrl: 'wode/wode.html',
		//我的控制器
		controller: 'WodeCtrl'
	})
	//我的订单路由
	.state('dingdan', {
		url: '/dingdan:id',
		templateUrl: 'wode/dingdan.html',
		controller: 'DingdanCtrl'
	})

	//全部订单路由
	.state('dingdan.qbdd', {
		url: '/qbdd',
		templateUrl: 'wode/qbdd.html',
		controller: function ($scope) {
			$scope.tabbardj($scope.orderBtns, 0);
			console.log($scope.orderBtns);
		}
	})
	//待付款路由
	.state('dingdan.dfk', {
		url: '/dfk',
		templateUrl: 'wode/dfk.html',
		controller: function ($scope) {
			$scope.tabbardj($scope.orderBtns, 1);
		}
	})
	//待收货路由
	.state('dingdan.dsh', {
		url: '/dsh',
		templateUrl: 'wode/dsh.html',
		controller: function ($scope) {
			$scope.tabbardj($scope.orderBtns, 2);
		}
	})
	//待评价路由
	.state('dingdan.dpj', {
		url: '/dpj',
		templateUrl: 'wode/dpj.html'
		,controller: function ($scope) {
			$scope.tabbardj($scope.orderBtns, 3);
		} 
	})
	//退款售后路由
	.state('dingdan.tksh', {
		url: '/tksh',
		templateUrl: 'wode/tksh.html'
		,controller: function ($scope) {
			$scope.tabbardj($scope.orderBtns, 4);
		} 
	})



	//详情路由
	.state('xiangqing', {
		url: 'xiangqing:id',
		templateUrl: 'gonggong/xiangqing.html',
		controller: 'XiangqingCtrl'
	})
}])
})